<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <!--      <el-form-item label="来源单号" prop="PICKINGID">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.PICKINGID"-->
      <!--          placeholder="请输入来源单号"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="入库批次号" prop="putinId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.putinId"-->
      <!--          placeholder="请输入入库批次号"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="putin_id_line" prop="putinIdLine">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.putinIdLine"-->
      <!--          placeholder="请输入putin_id_line"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="库存主键" prop="DOCCTNUMBER">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.DOCCTNUMBER"-->
      <!--          placeholder="请输入库存主键"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
            <el-form-item label="plcId" prop="plcId">
              <el-input
                v-model="queryParams.plcId"
                placeholder="请输入plcId"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
      <el-form-item label="产线编号" prop="GropSc">
        <el-input
          v-model="queryParams.GropSc"
          placeholder="请输入产线编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="产品型号" prop="BARCODE">
        <el-input
          v-model="queryParams.BARCODE"
          placeholder="请输入产品型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item label="库位编号" prop="locId">
        <el-input
          v-model="queryParams.locId"
          placeholder="请输入库位编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="托盘编号" prop="CTL">
        <el-input
          v-model="queryParams.CTL"
          placeholder="请输入托盘编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="物料编号" prop="goodId">
      <el-input
        v-model="queryParams.goodId"
        placeholder="请输入物料编号"
        clearable
        @keyup.enter.native="handleQuery"
      />
    </el-form-item>
      <el-form-item label="物料名称" prop="goodsNum">
        <el-input
          v-model="queryParams.goodsNum"
          placeholder="请输入物料名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

            <el-form-item label="目的库位" prop="EoutStand">
              <el-input
                v-model="queryParams.EoutStand"
                placeholder="请输入目的库位"
                clearable
                @keyup.enter.native="handleQuery"
              />
            </el-form-item>
      <el-form-item label="状态" prop="STATUS">
        <el-select v-model="queryParams.STATUS" placeholder="请选择状态" clearable>
          <el-option
            v-for="dict in dict.type.ck_sts"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="规格型号" prop="SPECIFICATION">
        <el-input
          v-model="queryParams.SPECIFICATION"
          placeholder="请输入规格型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!--        <el-form-item label="生产日期" prop="wareDateRange">-->
      <!--        <el-date-picker-->
      <!--          v-model="queryParams.wareDateRange"-->
      <!--          type="daterange"-->
      <!--          align="right"-->
      <!--          unlink-panels-->
      <!--          range-separator="至"-->
      <!--          start-placeholder="开始日期"-->
      <!--          end-placeholder="结束日期"-->
      <!--          value-format="yyyy-MM-dd"-->
      <!--          placeholder="请选择上架时间范围"-->
      <!--          @change="setQueryParams">-->
      <!--        </el-date-picker>-->
      <!--      </el-form-item>-->
      <el-form-item label="创建时间" prop="wareDates">
        <el-date-picker
          clearable
          v-model="queryParams.wareDates"
          type="datetimerange"
          range-separator="至"
          start-placeholder="开始日期时间"
          end-placeholder="结束日期时间"
          value-format="yyyy-MM-dd HH:mm:ss"
          placeholder="请选择创建时间范围">
        </el-date-picker>
      </el-form-item>
      <!--      <el-form-item label="中标供应商" prop="providerId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.providerId"-->
      <!--          placeholder="请输入中标供应商"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->

      <!--      <el-form-item label="单位" prop="UNIT">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.UNIT"-->
      <!--          placeholder="请输入单位"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="备注" prop="REMARK">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.REMARK"-->
      <!--          placeholder="请输入备注"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="出库单号" prop="outId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.outId"-->
      <!--          placeholder="请输入出库单号"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="重量单位" prop="scaleUnit">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.scaleUnit"-->
      <!--          placeholder="请输入重量单位"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="库区编号 工厂" prop="storageAreaId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.storageAreaId"-->
      <!--          placeholder="请输入库区编号 工厂"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="仓库编号" prop="storageId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.storageId"-->
      <!--          placeholder="请输入仓库编号"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="ToWhseloc" prop="ToWhseloc">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.ToWhseloc"-->
      <!--          placeholder="请输入ToWhseloc"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="typests" prop="typests">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.typests"-->
      <!--          placeholder="请输入typests"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="ProDucLotId" prop="ProDucLotId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.ProDucLotId"-->
      <!--          placeholder="请输入ProDucLotId"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->

      <!--      <el-form-item label="物料名称" prop="goodsName">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.goodsName"-->
      <!--          placeholder="请输入物料名称"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="PROT" prop="PROT">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.PROT"-->
      <!--          placeholder="请输入PROT"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="GOODS_MEASURE_ID" prop="goodsMeasureId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.goodsMeasureId"-->
      <!--          placeholder="请输入GOODS_MEASURE_ID"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="版本" prop="VERSION">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.VERSION"-->
      <!--          placeholder="请输入版本"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="物料类型" prop="goodsTypeid">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.goodsTypeid"-->
      <!--          placeholder="请输入物料类型"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="PARTDESC" prop="PARTDESC">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.PARTDESC"-->
      <!--          placeholder="请输入PARTDESC"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="BarCodeTpe" prop="BarCodeTpe">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.BarCodeTpe"-->
      <!--          placeholder="请输入BarCodeTpe"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="BarCodef" prop="BarCodef">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.BarCodef"-->
      <!--          placeholder="请输入BarCodef"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->

      <!--      <el-form-item label="lx" prop="lx">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.lx"-->
      <!--          placeholder="请输入lx"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="净重" prop="netWeigh">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.netWeigh"-->
      <!--          placeholder="请输入净重"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="stsErp" prop="stsErp">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.stsErp"-->
      <!--          placeholder="请输入stsErp"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="stsDj" prop="stsDj">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.stsDj"-->
      <!--          placeholder="请输入stsDj"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="	 gltrp" prop="gltrp">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.gltrp"-->
      <!--          placeholder="请输入	 gltrp"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="	 wgh" prop="wgh">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.wgh"-->
      <!--          placeholder="请输入	 wgh"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="	 HASVOLUME" prop="HASVOLUME">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.HASVOLUME"-->
      <!--          placeholder="请输入	 HASVOLUME"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="WAREHOUSING_ID" prop="warehousingId">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.warehousingId"-->
      <!--          placeholder="请输入WAREHOUSING_ID"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <!--      <el-form-item label="EoutStand" prop="EoutStand">-->
      <!--        <el-input-->
      <!--          v-model="queryParams.EoutStand"-->
      <!--          placeholder="请输入EoutStand"-->
      <!--          clearable-->
      <!--          @keyup.enter.native="handleQuery"-->
      <!--        />-->
      <!--      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
      <div class="float-right-container">
        <div class="chart-container">
          <div class="bar-container">
            <div class="bar" style="background-color: #faa5ac; height: 20px;"></div>
            <div class="label">未执行</div>
          </div>
          <div class="bar-container">
            <div class="bar" style="background-color: #ead6a3; height: 20px;"></div>
            <div class="label">堆垛机已写入</div>
          </div>
          <div class="bar-container">
            <div class="bar" style="background-color: #a9bfed; height: 20px;"></div>
            <div class="label">输送机已写入</div>
          </div>
          <div class="bar-container">
            <div class="bar" style="background-color: #a7dc83; height: 20px;"></div>
            <div class="label">堆垛机出库完成</div>
          </div>
        </div>
      </div>
    </el-form>

    <el-row :gutter="10" class="mb8">

      <el-col :span="1.5">
        <el-button
          type="success"
          size="mini"
          @click="handleUpdates"
        >修改状态
        </el-button>
      </el-col>

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table border
              ref="filterTable" v-loading="loading" :data="PICKINGWAVEGOODSList"
              @selection-change="handleSelectionChange" :row-style="rowStyle" >
      <el-table-column type="selection" width="55" align="center"/>
      <!--      <el-table-column sortable fixed label="来源单号" align="center" prop="PICKINGID" />-->
      <!--      <el-table-column label="入库批次号" align="center" prop="putinId" />-->
      <!--      <el-table-column label="putin_id_line" align="center" prop="putinIdLine" />-->
      <!--      <el-table-column label="库存主键" align="center" prop="DOCCTNUMBER" />-->
      <el-table-column
        fixed
        type="index"
        label="行号"
        width="60"
        align="center"
      />
      <el-table-column label="产线编号" sortable align="center" prop="gropSc" />
      <el-table-column label="产品型号" sortable align="center" prop="barcode" />
      <el-table-column label="库位编号" sortable align="center" prop="locId"/>
      <el-table-column label="托盘编号" sortable align="center" prop="ctl"/>
      <el-table-column label="物料编号" sortable align="center" prop="goodId"/>
      <el-table-column label="出库数量" sortable align="center" prop="goodsNum"/>
<!--      <el-table-column label="目的库位" sortable align="center" prop="OUTSTAND"/>-->
      <!--      <el-table-column label="站台" align="center" prop="OUTSTAND" />-->
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.ck_sts" :value="scope.row.status"/>
        </template>
      </el-table-column>

<!--      <el-table-column label="规格型号" align="center" prop="specification"/>-->
      <el-table-column label="目的货位" align="center" prop="eoutStand"/>
      <!--      <el-table-column label="生产日期" align="center" prop="productionDate" width="180">-->
      <!--        <template slot-scope="scope">-->
      <!--          <span>{{ parseTime(scope.row.productionDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <el-table-column label="出库时间" align="center" prop="wareDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.wareDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
        </template>
      </el-table-column>

      <!--      <el-table-column label="中标供应商" align="center" prop="providerId" />-->
      <!--      <el-table-column label="单位" align="center" prop="UNIT" />-->
      <!--      <el-table-column fixed="right" label="备注" align="center" prop="REMARK" />-->
      <!--      <el-table-column label="出库单号" align="center" prop="outId" />-->
      <!--      <el-table-column label="重量单位" align="center" prop="scaleUnit" />-->
      <!--      <el-table-column label="库存数量" align="center" prop="mistockNum" />-->
      <!--      <el-table-column label="已领数量" align="center" prop="pickingNum" />-->
      <!--      <el-table-column label="标准价格" align="center" prop="PRICE" />-->
      <!--      <el-table-column label="库区编号 工厂" align="center" prop="storageAreaId" />-->
      <!--      <el-table-column label="仓库编号" align="center" prop="storageId" />-->
      <!--      <el-table-column label="GOODS_NUM_SJ" align="center" prop="goodsNumSj" />-->
      <!--      <el-table-column label="ToWhseloc" align="center" prop="ToWhseloc" />-->
      <el-table-column label="出库任务类型" align="center" prop="typests">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.typests" :value="scope.row.typests"/>
        </template>
      </el-table-column>
      <el-table-column label="任务编号" align="center" prop="plcId"/>

      <!--      <el-table-column label="包装编号" align="center" prop="packingNum" />-->
      <!--      <el-table-column label="ProDucLotId" align="center" prop="ProDucLotId" />-->

      <!--      <el-table-column label="物料名称" align="center" prop="goodsName" />-->
      <!--      <el-table-column label="PROT" align="center" prop="PROT" />-->
      <!--      <el-table-column label="GOODS_MEASURE_ID" align="center" prop="goodsMeasureId" />-->
      <!--      <el-table-column label="时间类型" align="center" prop="DataType" />-->
      <!--      <el-table-column label="版本" align="center" prop="VERSION" />-->
      <!--      <el-table-column label="物料类型" align="center" prop="goodsTypeid" />-->
      <!--      <el-table-column label="endtype" align="center" prop="endtype" />-->
      <!--      <el-table-column label="PARTDESC" align="center" prop="PARTDESC" />-->
      <!--      <el-table-column label="UPGOODS_ID" align="center" prop="upgoodsId" />-->
      <!--      <el-table-column label="BarCodeTpe" align="center" prop="BarCodeTpe" />-->
      <!--      <el-table-column label="BarCodef" align="center" prop="BarCodef" />-->

      <!--      <el-table-column label="lx" align="center" prop="lx" />-->
      <!--      <el-table-column label="净重" align="center" prop="netWeigh" />-->
      <!--      <el-table-column label="stsErp" align="center" prop="stsErp" />-->
      <!--      <el-table-column label="stsDj" align="center" prop="stsDj" />-->
      <!--      <el-table-column label="	 gltrp" align="center" prop="gltrp" />-->
      <!--      <el-table-column label="	 ONSHELFUSE" align="center" prop="ONSHELFUSERID" />-->
      <!--      <el-table-column label="	 wgh" align="center" prop="wgh" />-->
      <!--      <el-table-column label="	 HASVOLUME" align="center" prop="HASVOLUME" />-->
      <!--      <el-table-column label="WAREHOUSING_ID" align="center" prop="warehousingId" />-->
      <!--      <el-table-column label="EoutStand" align="center" prop="EoutStand" />-->
      <!--      <el-table-column label="SAPMSG" align="center" prop="SAPMSG" />-->
      <!--     -->
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改出库任务查询对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="来源单号" prop="PICKINGID">
          <el-input v-model="form.PICKINGID" placeholder="请输入来源单号"/>
        </el-form-item>
        <el-form-item label="入库批次号" prop="putinId">
          <el-input v-model="form.putinId" placeholder="请输入入库批次号"/>
        </el-form-item>
        <el-form-item label="putin_id_line" prop="putinIdLine">
          <el-input v-model="form.putinIdLine" placeholder="请输入putin_id_line"/>
        </el-form-item>
        <el-form-item label="库存主键" prop="DOCCTNUMBER">
          <el-input v-model="form.DOCCTNUMBER" placeholder="请输入库存主键"/>
        </el-form-item>
        <el-form-item label="	 plcId" prop="plcId">
          <el-input v-model="form.plcId" placeholder="请输入	 plcId"/>
        </el-form-item>
        <el-form-item label="物料编号" prop="goodId">
          <el-input v-model="form.goodId" placeholder="请输入物料编号"/>
        </el-form-item>
        <el-form-item label="库位编号" prop="locId">
          <el-input v-model="form.locId" placeholder="请输入库位编号"/>
        </el-form-item>
        <el-form-item label="容器编号" prop="CTL">
          <el-input v-model="form.CTL" placeholder="请输入容器编号"/>
        </el-form-item>
        <el-form-item label="站台" prop="OUTSTAND">
          <el-input v-model="form.OUTSTAND" placeholder="请输入站台"/>
        </el-form-item>
        <el-form-item label="状态" prop="STATUS">
          <el-select v-model="form.STATUS" placeholder="请选择状态">
            <el-option
              v-for="dict in dict.type.status"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="规格型号" prop="SPECIFICATION">
          <el-input v-model="form.SPECIFICATION" placeholder="请输入规格型号"/>
        </el-form-item>
        <el-form-item label="生产日期" prop="productionDate">
          <el-date-picker clearable
                          v-model="form.productionDate"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择生产日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="下架时间" prop="wareDate">
          <el-date-picker clearable
                          v-model="form.wareDate"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="请选择下架时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="中标供应商" prop="providerId">
          <el-input v-model="form.providerId" placeholder="请输入中标供应商"/>
        </el-form-item>
        <el-form-item label="单位" prop="UNIT">
          <el-input v-model="form.UNIT" placeholder="请输入单位"/>
        </el-form-item>
        <el-form-item label="备注" prop="REMARK">
          <el-input v-model="form.REMARK" placeholder="请输入备注"/>
        </el-form-item>
        <el-form-item label="出库单号" prop="outId">
          <el-input v-model="form.outId" placeholder="请输入出库单号"/>
        </el-form-item>
        <el-form-item label="重量单位" prop="scaleUnit">
          <el-input v-model="form.scaleUnit" placeholder="请输入重量单位"/>
        </el-form-item>
        <el-form-item label="库区编号 工厂" prop="storageAreaId">
          <el-input v-model="form.storageAreaId" placeholder="请输入库区编号 工厂"/>
        </el-form-item>
        <el-form-item label="仓库编号" prop="storageId">
          <el-input v-model="form.storageId" placeholder="请输入仓库编号"/>
        </el-form-item>
        <el-form-item label="ToWhseloc" prop="ToWhseloc">
          <el-input v-model="form.ToWhseloc" placeholder="请输入ToWhseloc"/>
        </el-form-item>
        <el-form-item label="typests" prop="typests">
          <el-input v-model="form.typests" placeholder="请输入typests"/>
        </el-form-item>
        <el-form-item label="ProDucLotId" prop="ProDucLotId">
          <el-input v-model="form.ProDucLotId" placeholder="请输入ProDucLotId"/>
        </el-form-item>
        <el-form-item label="条形码" prop="BARCODE">
          <el-input v-model="form.BARCODE" placeholder="请输入条形码"/>
        </el-form-item>
        <el-form-item label="物料名称" prop="goodsName">
          <el-input v-model="form.goodsName" placeholder="请输入物料名称"/>
        </el-form-item>
        <el-form-item label="PROT" prop="PROT">
          <el-input v-model="form.PROT" placeholder="请输入PROT"/>
        </el-form-item>
        <el-form-item label="GOODS_MEASURE_ID" prop="goodsMeasureId">
          <el-input v-model="form.goodsMeasureId" placeholder="请输入GOODS_MEASURE_ID"/>
        </el-form-item>
        <el-form-item label="版本" prop="VERSION">
          <el-input v-model="form.VERSION" placeholder="请输入版本"/>
        </el-form-item>
        <el-form-item label="物料类型" prop="goodsTypeid">
          <el-input v-model="form.goodsTypeid" placeholder="请输入物料类型"/>
        </el-form-item>
        <el-form-item label="PARTDESC" prop="PARTDESC">
          <el-input v-model="form.PARTDESC" placeholder="请输入PARTDESC"/>
        </el-form-item>
        <el-form-item label="UPGOODS_ID" prop="upgoodsId">
          <el-input v-model="form.upgoodsId" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="BarCodeTpe" prop="BarCodeTpe">
          <el-input v-model="form.BarCodeTpe" placeholder="请输入BarCodeTpe"/>
        </el-form-item>
        <el-form-item label="BarCodef" prop="BarCodef">
          <el-input v-model="form.BarCodef" placeholder="请输入BarCodef"/>
        </el-form-item>
        <el-form-item label="GropSc" prop="GropSc">
          <el-input v-model="form.GropSc" placeholder="请输入GropSc"/>
        </el-form-item>
        <el-form-item label="lx" prop="lx">
          <el-input v-model="form.lx" placeholder="请输入lx"/>
        </el-form-item>
        <el-form-item label="净重" prop="netWeigh">
          <el-input v-model="form.netWeigh" placeholder="请输入净重"/>
        </el-form-item>
        <el-form-item label="stsErp" prop="stsErp">
          <el-input v-model="form.stsErp" placeholder="请输入stsErp"/>
        </el-form-item>
        <el-form-item label="stsDj" prop="stsDj">
          <el-input v-model="form.stsDj" placeholder="请输入stsDj"/>
        </el-form-item>
        <el-form-item label="	 gltrp" prop="gltrp">
          <el-input v-model="form.gltrp" placeholder="请输入	 gltrp"/>
        </el-form-item>
        <el-form-item label="	 ONSHELFUSE" prop="ONSHELFUSERID">
          <el-input v-model="form.ONSHELFUSERID" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
        <el-form-item label="	 wgh" prop="wgh">
          <el-input v-model="form.wgh" placeholder="请输入	 wgh"/>
        </el-form-item>
        <el-form-item label="	 HASVOLUME" prop="HASVOLUME">
          <el-input v-model="form.HASVOLUME" placeholder="请输入	 HASVOLUME"/>
        </el-form-item>
        <el-form-item label="WAREHOUSING_ID" prop="warehousingId">
          <el-input v-model="form.warehousingId" placeholder="请输入WAREHOUSING_ID"/>
        </el-form-item>
        <el-form-item label="EoutStand" prop="EoutStand">
          <el-input v-model="form.EoutStand" placeholder="请输入EoutStand"/>
        </el-form-item>
        <el-form-item label="SAPMSG" prop="SAPMSG">
          <el-input v-model="form.SAPMSG" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <el-dialog
      title="修改出库订单状态"
      :visible.sync="dialogVisible"
      width="30%">
      <el-form :model="form">
        <el-form-item label="状态">
          <el-select v-model="form.sts" placeholder="请选择状态">
            <el-option
              v-for="dict in dict.type.ck_sts"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="handleConfirm">确定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<style>
.float-right-container {
  float: right; /* 容器向右浮动 */
  clear: both; /* 清除浮动，避免影响后续元素 */
}
.chart-container {
  display: flex;
  align-items: center; /* 使所有条形图和标签垂直居中 */
  gap: 10px; /* 条形图之间的间隔 */
}

.bar-container {
  display: flex;
  flex-direction: column;
  align-items: center; /* 使条形图和标签水平居中 */
}

.bar {
  width: 100px; /* 假设条形图的宽度为50px */
  margin-bottom: 5px; /* 条形图和标签之间的间隔 */
}

.label {
  font-size: 14px; /* 标签的字体大小 */
  color: #333; /* 标签的文字颜色 */
}
</style>
<script>
import {
  listPICKINGWAVEGOODS,
  getPICKINGWAVEGOODS,
  delPICKINGWAVEGOODS,
  addPICKINGWAVEGOODS,
  updatePICKINGWAVEGOODS,
  updateCkRwSts
} from "@/api/system/pickingwavegoods";
import {updateCkSts} from "@/api/system/ORDERDETAIL";

export default {
  name: "PICKINGWAVEGOODS",
  dicts: ['ck_sts','typests'],
  data() {
    return {
      dialogVisible: false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 出库任务查询表格数据
      PICKINGWAVEGOODSList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        wareDates: [],
        pageNum: 1,
        pageSize: 10,
        PICKINGID: null,
        putinId: null,
        putinIdLine: null,
        DOCCTNUMBER: null,
        plcId: null,
        goodId: null,
        locId: null,
        CTL: null,
        OUTSTAND: null,
        STATUS: null,
        goodsNum: null,
        SPECIFICATION: null,
        productionDate: null,
        wareDate: null,
        providerId: null,
        UNIT: null,
        REMARK: null,
        outId: null,
        scaleUnit: null,
        mistockNum: null,
        pickingNum: null,
        PRICE: null,
        storageAreaId: null,
        storageId: null,
        goodsNumSj: null,
        ToWhseloc: null,
        typests: null,
        packingNum: null,
        ProDucLotId: null,
        BARCODE: null,
        goodsName: null,
        PROT: null,
        goodsMeasureId: null,
        DataType: null,
        VERSION: null,
        goodsTypeid: null,
        endtype: null,
        PARTDESC: null,
        upgoodsId: null,
        BarCodeTpe: null,
        BarCodef: null,
        GropSc: null,
        lx: null,
        netWeigh: null,
        stsErp: null,
        stsDj: null,
        gltrp: null,
        ONSHELFUSERID: null,
        wgh: null,
        HASVOLUME: null,
        warehousingId: null,
        EoutStand: null,
        SAPMSG: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {},
      locId: [],
      plcId: [],
      refreshInterval: null
    };
  },
  created() {
    this.getList();
    this.startAutoRefresh();
  },
  beforeDestroy() {
    this.stopAutoRefresh();
  },
  methods: {
    startAutoRefresh() {
      this.refreshInterval = setInterval(() => {
        this.getList();
      }, 60000); // 60 seconds
    },
    stopAutoRefresh() {
      if (this.refreshInterval) {
        clearInterval(this.refreshInterval);
      }
    },
    rowStyle({row, rowIndex}) {
      if (row.status === "0") {
        return {backgroundColor: '#ec949b'}; // 返回被点击行的样式
      }else if (row.status === '1') {
        return {backgroundColor: '#ead6a3'};
      }else if (row.status === '2') {
        return {backgroundColor: '#a9bfed'};
      }else if (row.status === '10') {
        return {backgroundColor: '#a7dc83'};
      }
      return '';
    },
    /** 查询出库任务查询列表 */
    getList() {
      this.loading = true;
      listPICKINGWAVEGOODS(this.queryParams).then(response => {
        this.PICKINGWAVEGOODSList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    setQueryParams(wareDateRange) {
      if (wareDateRange && wareDateRange.length === 2) {
        this.queryParams.startDate = wareDateRange[0];
        this.queryParams.endDate = wareDateRange[1];
      } else {
        this.queryParams.startDate = null;
        this.queryParams.endDate = null;
      }
      this.getList();
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        PICKINGID: null,
        putinId: null,
        putinIdLine: null,
        DOCCTNUMBER: null,
        plcId: null,
        goodId: null,
        locId: null,
        CTL: null,
        OUTSTAND: null,
        STATUS: null,
        goodsNum: null,
        SPECIFICATION: null,
        productionDate: null,
        wareDate: null,
        providerId: null,
        UNIT: null,
        REMARK: null,
        outId: null,
        scaleUnit: null,
        mistockNum: null,
        pickingNum: null,
        PRICE: null,
        storageAreaId: null,
        storageId: null,
        goodsNumSj: null,
        ToWhseloc: null,
        typests: null,
        packingNum: null,
        ProDucLotId: null,
        BARCODE: null,
        goodsName: null,
        PROT: null,
        goodsMeasureId: null,
        DataType: null,
        VERSION: null,
        goodsTypeid: null,
        endtype: null,
        PARTDESC: null,
        upgoodsId: null,
        BarCodeTpe: null,
        BarCodef: null,
        GropSc: null,
        lx: null,
        netWeigh: null,
        stsErp: null,
        stsDj: null,
        gltrp: null,
        ONSHELFUSERID: null,
        wgh: null,
        HASVOLUME: null,
        warehousingId: null,
        EoutStand: null,
        SAPMSG: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.PICKINGID)
      this.ids = selection.map(item => item.picid)

      this.plcId = selection.map(item => item.plcId)
      console.log(this.locaId,"124")
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加出库任务查询";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const PICKINGID = row.PICKINGID || this.ids
      getPICKINGWAVEGOODS(PICKINGID).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改出库任务查询";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.PICKINGID != null) {
            updatePICKINGWAVEGOODS(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addPICKINGWAVEGOODS(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const PICKINGIDs = row.PICKINGID || this.ids;
      this.$modal.confirm('是否确认删除出库任务查询编号为"' + PICKINGIDs + '"的数据项？').then(function () {
        return delPICKINGWAVEGOODS(PICKINGIDs);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/PICKINGWAVEGOODS/export', {
        ...this.queryParams
      }, `PICKINGWAVEGOODS_${new Date().getTime()}.xlsx`)
    },
    handleUpdates(row) {
      this.dialogVisible = true
    },
    handleConfirm() {
      this.$modal.confirm('是否修改此任务的状态？').then(() => {
        updateCkRwSts({ status: this.form.sts,picId:this.plcId}).then(response => {
          this.$modal.msgSuccess("修改成功");
          this.getList();
          this.dialogVisible = false; // 显示对话框
        })
      }).catch(() => {
      });
    },
  }
};
</script>
